In [19]:
%matplotlib inline
import LogReader as lr
import LogDataStructures as ls
fieldopt_path = "/home/einar/Documents/GitHub/PCG/FieldOpt/"
output_dir_path = "/home/einar/Documents/GitHub/PCG/fieldopt_output/adgprs5/"
hdf5_summary_file_name = "5SPOT.SIM.H5"
reader = lr.LogReader(output_dir_path)
case_container = ls.CaseContainer(reader.case_log, reader.property_uuid_name_map)
optimizer = ls.Optimizer(reader.optimization_log, case_container)
simulator = ls.Simulator(reader.simulation_log)
In [20]:
compdat_log_path = "/home/einar/Documents/GitHub/PCG/fieldopt_output/log_compdat.out"
compdat_file_lines = []
with open(compdat_log_path, 'r') as f:
compdat_contents = f.read()
compdat_file_lines = compdat_contents.split("\n")
compdat_map = {}
l = 0
while l < len(compdat_file_lines):
if len(compdat_file_lines[l].strip()) == 0: # Skip line if it contains only whitespace
l = l+1
elif compdat_file_lines[l].split(':')[0] == 'UUID': # found a new case
uuid = compdat_file_lines[l].split(' ')[1]
l = l+1
compdat_entry = ""
while compdat_file_lines[l].strip() != '/': # loop until end of the compdat
compdat_entry = compdat_entry + compdat_file_lines[l] + '\n'
l = l+1
compdat_entry = compdat_entry + '/\n'
compdat_map[uuid] = compdat_entry
else:
l = l+1
In [22]:
print(compdat_map[optimizer.best_case_pr_iteration[-1].uuid])